import request from '@/config/axios'

// BPM 流程表达式 VO
export interface ProcessExpressionVO {
  id: number // 编号
  name: string // 表达式名称
  expression: string // 表达式
  status: number // 状态
}


// BPM 流程表达式 API
export const ProcessExpressionApi = {
  // 获取BPM 流程表达式分页
  getProcessExpressionPage: async (params: PageParam) => {
    return await request.get({ url: `/bpm/process-expression/page`, params })
  },

  // 获取BPM 流程表达式详情
  getProcessExpression: async (id: number) => {
    return await request.get({ url: `/bpm/process-expression/get`, params: { id } })
  },

  // 新增BPM 流程表达式
  createProcessExpression: async (data: ProcessExpressionVO) => {
    return await request.post({ url: `/bpm/process-expression/create`, data })
  },

  // 修改BPM 流程表达式
  updateProcessExpression: async (data: ProcessExpressionVO) => {
    return await request.post({ url: `/bpm/process-expression/update`, data })
  },

  // 删除BPM 流程表达式
  deleteProcessExpression: async (id: number) => {
    return await request.delete({ url: `/bpm/process-expression/delete`, params: { id } })
  }
}
